/*左右两边圆弧的按钮-颜色充满*/
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:frametrim/utility/screen.dart';

//点击事件回调
class ButtonRoundView extends StatelessWidget {
  late final String textStr;
  late final Color textColor;
  late final Color buttonColor;
  late final double? textSize;
  late final double mHorizontalPadding;
  late final double mVerticalPadding;
  late final VoidCallback? onPress;

  ButtonRoundView(
      {required this.textStr,
      required this.textColor,
      required this.buttonColor,
      this.mHorizontalPadding = 10,
      this.mVerticalPadding = 5,
      this.textSize,
      this.onPress});

  @override
  Widget build(BuildContext context) {
    return Container(
      /* height: 45,
      width: Screen.width,
      margin: EdgeInsets.fromLTRB(28, 20, 28, 20),*/
      child: RaisedButton(
        elevation: 0,
        padding: EdgeInsets.symmetric(
            horizontal: mHorizontalPadding, vertical: mVerticalPadding),
        /*按钮颜色*/
        color: buttonColor,
        textColor: textColor,
        child: Text(
          textStr,
          style: TextStyle(fontSize: textSize != null ? textSize : 15),
        ),
        /*圆角样式*/
        shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.only(
                topLeft: Radius.circular(3),
                topRight: Radius.circular(3),
                bottomRight: Radius.circular(3),
                bottomLeft: Radius.circular(3))),
        // 水波动画中水波的颜色
        splashColor: buttonColor,
        onPressed: onPress,
      ),
    );
  }
}
